#include<bits/stdc++.h>
using namespace std;
#define int long long 
const int N=1e5+10;
int a[N];
int n;
bool check(int num)
{
    if((num&(num-1))==0) return true;
    else return false;
}

signed main()
{
    cin>>n;
    int ret=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        if(check(a[i])) ret++;
    }
    cout<<ret;
    return 0;
}